Dynomotion

Group: DynoMotion Message: 6451 From: himykabibble Date: 1/13/2013
Subject: GUI Update Questions
Tom/Brad,

I took a quick stab at re-implementing MainStatus as my primary data source for GUI updates, and it did not go well. I suspect I am saturating the USB channel. I have a worker thread that sleeps for 50 mSec, then wakes up, and updates all the DROs. Every 4th time it wakes up, it updates all the GUI controls. If I update MainStatus every time it wakes up, the app will eventually lock up. Up to this point, I've been using CoordMotion.Interpreter.ReadCurInterpreterPosition() to get the current positions for the DRO updates. I'm assuming this does actually get the positions from the DSP, rather than passing back some cached values, is that correct? If so, I will leave that as-is, and only update MainStatus when I do the update on all the controls.

Regards,
Ray L.
Group: DynoMotion Message: 6452 From: Brad Murry Date: 1/13/2013
Subject: Re: GUI Update Questions

I had similar issues, which is why I implemented the ‘buffered’ CurrentStatus Property.

 

 

From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On Behalf Of himykabibble
Sent: Sunday, January 13, 2013 9:45 AM
To: DynoMotion@yahoogroups.com
Subject: [DynoMotion] GUI Update Questions

 

 

Tom/Brad,

I took a quick stab at re-implementing MainStatus as my primary data source for GUI updates, and it did not go well. I suspect I am saturating the USB channel. I have a worker thread that sleeps for 50 mSec, then wakes up, and updates all the DROs. Every 4th time it wakes up, it updates all the GUI controls. If I update MainStatus every time it wakes up, the app will eventually lock up. Up to this point, I've been using CoordMotion.Interpreter.ReadCurInterpreterPosition() to get the current positions for the DRO updates. I'm assuming this does actually get the positions from the DSP, rather than passing back some cached values, is that correct? If so, I will leave that as-is, and only update MainStatus when I do the update on all the controls.

Regards,
Ray L.

Group: DynoMotion Message: 6453 From: himykabibble Date: 1/13/2013
Subject: Re: GUI Update Questions
Brad,

So your recommendation is to let dotNet do the updates? Is a 50 mSec update interval reasonable? Is it more efficient to use the ReadCurInterpreterPosition call when only updating position DROs?

I do *seem* to have it working now, I think - I needed to do an invoke when I updated the status.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Brad Murry wrote:
>
> I had similar issues, which is why I implemented the 'buffered'
> CurrentStatus Property.
>
>
>
>
>
> From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On
> Behalf Of himykabibble
> Sent: Sunday, January 13, 2013 9:45 AM
> To: DynoMotion@yahoogroups.com
> Subject: [DynoMotion] GUI Update Questions
>
>
>
>
>
> Tom/Brad,
>
> I took a quick stab at re-implementing MainStatus as my primary data source
> for GUI updates, and it did not go well. I suspect I am saturating the USB
> channel. I have a worker thread that sleeps for 50 mSec, then wakes up, and
> updates all the DROs. Every 4th time it wakes up, it updates all the GUI
> controls. If I update MainStatus every time it wakes up, the app will
> eventually lock up. Up to this point, I've been using
> CoordMotion.Interpreter.ReadCurInterpreterPosition() to get the current
> positions for the DRO updates. I'm assuming this does actually get the
> positions from the DSP, rather than passing back some cached values, is that
> correct? If so, I will leave that as-is, and only update MainStatus when I
> do the update on all the controls.
>
> Regards,
> Ray L.
>
Group: DynoMotion Message: 6454 From: brad murry Date: 1/13/2013
Subject: Re: GUI Update Questions
Hello Ray,
 
I can't for the life of me remember what I used for an interval, probably the default setting.  The max tightness of you loop likely varies system to system.
 
For the human eye, I cant see why you would need an update greater that 100~200 ms, but of course that is just subjective opinion.
 
 
ReadCurInterpreterPosition boils down to console commands, so I doubt it is any more efficient.

 -Brad Murry
Group: DynoMotion Message: 6455 From: himykabibble Date: 1/13/2013
Subject: Re: GUI Update Questions
OK, I now seem to have MainStatus working OK, and I'm using it to update *some* of the GUI controls. But the position DROs, I have a question. ReadCurInterpreterPosition is, apparently, not very efficient. Is there a more efficient way to get the current position in real-world units? MainStatus is not useful for this, unless I do the conversion from KFlop counts to real-world position, which seems an unreasonable thing to do.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, brad murry wrote:
>
>
> Hello Ray, I can't for the life of me remember what I used for an interval, probably the default setting. The max tightness of you loop likely varies system to system. For the human eye, I cant see why you would need an update greater that 100~200 ms, but of course that is just subjective opinion. ReadCurInterpreterPosition boils down to console commands, so I doubt it is any more efficient.
> -Brad MurryTo: DynoMotion@yahoogroups.com
> From: jagboy1964@...
> Date: Sun, 13 Jan 2013 17:10:41 +0000
> Subject: [DynoMotion] Re: GUI Update Questions
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Brad,
>
>
>
> So your recommendation is to let dotNet do the updates? Is a 50 mSec update interval reasonable? Is it more efficient to use the ReadCurInterpreterPosition call when only updating position DROs?
>
>
>
> I do *seem* to have it working now, I think - I needed to do an invoke when I updated the status.
>
>
>
> Regards,
>
> Ray L.
>
>
>
> --- In DynoMotion@yahoogroups.com, Brad Murry wrote:
>
> >
>
> > I had similar issues, which is why I implemented the 'buffered'
>
> > CurrentStatus Property.
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On
>
> > Behalf Of himykabibble
>
> > Sent: Sunday, January 13, 2013 9:45 AM
>
> > To: DynoMotion@yahoogroups.com
>
> > Subject: [DynoMotion] GUI Update Questions
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > Tom/Brad,
>
> >
>
> > I took a quick stab at re-implementing MainStatus as my primary data source
>
> > for GUI updates, and it did not go well. I suspect I am saturating the USB
>
> > channel. I have a worker thread that sleeps for 50 mSec, then wakes up, and
>
> > updates all the DROs. Every 4th time it wakes up, it updates all the GUI
>
> > controls. If I update MainStatus every time it wakes up, the app will
>
> > eventually lock up. Up to this point, I've been using
>
> > CoordMotion.Interpreter.ReadCurInterpreterPosition() to get the current
>
> > positions for the DRO updates. I'm assuming this does actually get the
>
> > positions from the DSP, rather than passing back some cached values, is that
>
> > correct? If so, I will leave that as-is, and only update MainStatus when I
>
> > do the update on all the controls.
>
> >
>
> > Regards,
>
> > Ray L.
>
> >
>
Group: DynoMotion Message: 6456 From: himykabibble Date: 1/13/2013
Subject: Re: GUI Update Questions
Tom/Brad,

Something that appears never to have worked correctly, from at least 4.29z through 4.30j:

KMAxes[String].CheckEnabled();

always seems to return true. This is what I was using to detect a disabled axis, which indicates a limit has been hit. It never worked right. I've now changed it to use MainStatus.GetAxisEnabled(int), and it works perfectly with no other changes.

Regards,
Ray L.


--- In DynoMotion@yahoogroups.com, "himykabibble" wrote:
>
> OK, I now seem to have MainStatus working OK, and I'm using it to update *some* of the GUI controls. But the position DROs, I have a question. ReadCurInterpreterPosition is, apparently, not very efficient. Is there a more efficient way to get the current position in real-world units? MainStatus is not useful for this, unless I do the conversion from KFlop counts to real-world position, which seems an unreasonable thing to do.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, brad murry wrote:
> >
> >
> > Hello Ray, I can't for the life of me remember what I used for an interval, probably the default setting. The max tightness of you loop likely varies system to system. For the human eye, I cant see why you would need an update greater that 100~200 ms, but of course that is just subjective opinion. ReadCurInterpreterPosition boils down to console commands, so I doubt it is any more efficient.
> > -Brad MurryTo: DynoMotion@yahoogroups.com
> > From: jagboy1964@
> > Date: Sun, 13 Jan 2013 17:10:41 +0000
> > Subject: [DynoMotion] Re: GUI Update Questions
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Brad,
> >
> >
> >
> > So your recommendation is to let dotNet do the updates? Is a 50 mSec update interval reasonable? Is it more efficient to use the ReadCurInterpreterPosition call when only updating position DROs?
> >
> >
> >
> > I do *seem* to have it working now, I think - I needed to do an invoke when I updated the status.
> >
> >
> >
> > Regards,
> >
> > Ray L.
> >
> >
> >
> > --- In DynoMotion@yahoogroups.com, Brad Murry wrote:
> >
> > >
> >
> > > I had similar issues, which is why I implemented the 'buffered'
> >
> > > CurrentStatus Property.
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On
> >
> > > Behalf Of himykabibble
> >
> > > Sent: Sunday, January 13, 2013 9:45 AM
> >
> > > To: DynoMotion@yahoogroups.com
> >
> > > Subject: [DynoMotion] GUI Update Questions
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > Tom/Brad,
> >
> > >
> >
> > > I took a quick stab at re-implementing MainStatus as my primary data source
> >
> > > for GUI updates, and it did not go well. I suspect I am saturating the USB
> >
> > > channel. I have a worker thread that sleeps for 50 mSec, then wakes up, and
> >
> > > updates all the DROs. Every 4th time it wakes up, it updates all the GUI
> >
> > > controls. If I update MainStatus every time it wakes up, the app will
> >
> > > eventually lock up. Up to this point, I've been using
> >
> > > CoordMotion.Interpreter.ReadCurInterpreterPosition() to get the current
> >
> > > positions for the DRO updates. I'm assuming this does actually get the
> >
> > > positions from the DSP, rather than passing back some cached values, is that
> >
> > > correct? If so, I will leave that as-is, and only update MainStatus when I
> >
> > > do the update on all the controls.
> >
> > >
> >
> > > Regards,
> >
> > > Ray L.
> >
> > >
> >
>
Group: DynoMotion Message: 6457 From: Tom Kerekes Date: 1/13/2013
Subject: Re: GUI Update Questions
Hi Ray,

I think the function you need to do the conversion for you is the Interpreter function:

ConvertAbsoluteToInterpreterCoord

Which is what KMotionCNC uses.  But it is not currently exported in .NET.

I will export it.

Regards
TK

Group: DynoMotion Message: 6458 From: himykabibble Date: 1/13/2013
Subject: Re: GUI Update Questions
Tom,

I need to be able to get current position in both Machine and User coordinates.

Regards,
Ray L.

--- In DynoMotion@yahoogroups.com, Tom Kerekes wrote:
>
> Hi Ray,
>
> I think the function you need to do the conversion for you is the Interpreter function:
>
> ConvertAbsoluteToInterpreterCoord
>
> Which is what KMotionCNC uses.  But it is not currently exported in .NET.
>
> I will export it.
>
> Regards
> TK
>
>
>
> ________________________________
> From: himykabibble
> To: DynoMotion@yahoogroups.com
> Sent: Sunday, January 13, 2013 11:00 AM
> Subject: [DynoMotion] Re: GUI Update Questions
>
>
>  
> OK, I now seem to have MainStatus working OK, and I'm using it to update *some* of the GUI controls. But the position DROs, I have a question. ReadCurInterpreterPosition is, apparently, not very efficient. Is there a more efficient way to get the current position in real-world units? MainStatus is not useful for this, unless I do the conversion from KFlop counts to real-world position, which seems an unreasonable thing to do.
>
> Regards,
> Ray L.
>
> --- In DynoMotion@yahoogroups.com, brad murry wrote:
> >
> >
> > Hello Ray, I can't for the life of me remember what I used for an interval, probably the default setting. The max tightness of you loop likely varies system to system. For the human eye, I cant see why you would need an update greater that 100~200 ms, but of course that is just subjective opinion. ReadCurInterpreterPosition boils down to console commands, so I doubt it is any more efficient.
> > -Brad MurryTo: DynoMotion@yahoogroups.com
> > From: jagboy1964@
> > Date: Sun, 13 Jan 2013 17:10:41 +0000
> > Subject: [DynoMotion] Re: GUI Update Questions
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Brad,
> >
> >
> >
> > So your recommendation is to let dotNet do the updates? Is a 50 mSec update interval reasonable? Is it more efficient to use the ReadCurInterpreterPosition call when only updating position DROs?
> >
> >
> >
> > I do *seem* to have it working now, I think - I needed to do an invoke when I updated the status.
> >
> >
> >
> > Regards,
> >
> > Ray L.
> >
> >
> >
> > --- In DynoMotion@yahoogroups.com, Brad Murry wrote:
> >
> > >
> >
> > > I had similar issues, which is why I implemented the 'buffered'
> >
> > > CurrentStatus Property.
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > From: DynoMotion@yahoogroups.com [mailto:DynoMotion@yahoogroups.com] On
> >
> > > Behalf Of himykabibble
> >
> > > Sent: Sunday, January 13, 2013 9:45 AM
> >
> > > To: DynoMotion@yahoogroups.com
> >
> > > Subject: [DynoMotion] GUI Update Questions
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > >
> >
> > > Tom/Brad,
> >
> > >
> >
> > > I took a quick stab at re-implementing MainStatus as my primary data source
> >
> > > for GUI updates, and it did not go well. I suspect I am saturating the USB
> >
> > > channel. I have a worker thread that sleeps for 50 mSec, then wakes up, and
> >
> > > updates all the DROs. Every 4th time it wakes up, it updates all the GUI
> >
> > > controls. If I update MainStatus every time it wakes up, the app will
> >
> > > eventually lock up. Up to this point, I've been using
> >
> > > CoordMotion.Interpreter.ReadCurInterpreterPosition() to get the current
> >
> > > positions for the DRO updates. I'm assuming this does actually get the
> >
> > > positions from the DSP, rather than passing back some cached values, is that
> >
> > > correct? If so, I will leave that as-is, and only update MainStatus when I
> >
> > > do the update on all the controls.
> >
> > >
> >
> > > Regards,
> >
> > > Ray L.
> >
> > >
> >
>
Group: DynoMotion Message: 6459 From: Tom Kerekes Date: 1/13/2013
Subject: Re: GUI Update Questions
Hi Ray,

Good point.  I will export:

    GC_dll->ConvertAbsoluteToMachine(dx, dy, dz, da, db, dc, &dx, &dy, &dz, &da, &db, &dc);

also

TK